<?php

class shipping_carrier_vl extends a_base_shipping_carrier {

    public function get_shipgment_transactional_info(order_m_order $obj) {

    }

    public function __save_shipping_info(shipping_rate_object $sro) {
        //debug_dump($sr->get_rates());
    }

    public function __get_rates() {
        $rates = array();
        $rate = new shipping_rate_object();
        $rate->id = "option_one";
        $rate->desc = "By ground";
        $rate->speed = "2 days";
        $rate->price = "10.0";
        $rate->carrier_id = $this->get_carrier_id();
        $rates[0] = $rate;
        $rate = new shipping_rate_object();
        $rate->id = "option_two";
        $rate->desc = "By air";
        $rate->price = "40.0";
        $rate->speed = "1 day";
        $rate->carrier_id = $this->get_carrier_id();
        $rates[1] = $rate;
        return $rates;
    }

    public function clear_shipment_info() {

    }

    public function is_valid_for_rates() {
        //@TO_DO : check necessary things like province etc 
        return TRUE;
    }

    public function get_valid_rate_selection(shipping_rates $sr, CI_Input $ci_post) {
        $this->set_error_message("must select an option/rate");
        return $sr->get_rate($ci_post->post($sr->get_carrier_id()."_rate_id"));
    }

}

?>